home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 828 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: thp@cs.ucr.edu (Tom Payne)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Referencing pointers after delete
  5. Date: 22 Mar 1996 22:20:52 GMT
  6. Organization: University of California, Riverside
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4iv8bd$5vh@galaxy.ucr.edu>
  9. References: <4is05t$ceo@engnews1.Eng.Sun.COM> <4is1a5$cag@engnews1.Eng.Sun.COM>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. X-Nntp-Posting-Host: corvette.ucr.edu
  12. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  13. Content-Length: 1212
  14. X-Lines: 26
  15. Originator: clamage@taumet
  16.  
  17. Steve Clamage (clamage@Eng.Sun.COM) wrote:
  18. : In article ceo@engnews1.Eng.Sun.COM, "joe (j.) halpin" <jhalpin@bnr.ca>
  19. : writes:
  20. : >
  21. : >In 3.7.3.2.4 the January working paper says:
  22. : >
  23. : >4 A deallocation function can free the storage referenced by the pointer
  24. : >  given  as  its  argument and renders the pointer invalid.  The storage
  25. : >  can be made available for further allocation.  An invalid pointer con-
  26. : >  tains an unusable value:  it cannot even be used in an expression.
  27. [...]
  28. : The reason for the odd-looking condition (which follows the C
  29. : standard) is to allow architectures which validate pointers in
  30. : hardware to be standard-conforming. Example:
  31. [...]
  32. : You can't do anything useful in portable code with uninitialized pointers,
  33. : or pointers which point to objects which are no longer available. The
  34. : standard allows the implementation a great deal of leeway in trying to
  35. : help by identifying such invalid uses.
  36.  
  37. ... just as for arithmetic exceptions, which also engender "undefined
  38. behavior."  But why the leeway to, say, reformat the disk, rather
  39. than specifying the normal practice, which is to invoke a signal
  40. handler, thereby, keeping the behavior defined?
  41.  
  42. Tom Payne (thp@cs.ucr.edu)
  43.  
  44.  
  45. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  46. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  47. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  48. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  49. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  50.